{extend name="public/base" /}

{block name="title"}<title>列表</title>{/block}

{block name="pjax_container"}
<style>
    tr>th,
    td {
        text-align: center;
    }
    
.content-header>.breadcrumb>li{
    color: #999;
}
.content-header>.breadcrumb>.active{
    color: #666;
}
.content-header{
    height: 51px;
 
}
.btn-primary{
      background-color: #1890FF;
    color: #fff;
    border: none;
    border-radius: 6px !important;
    margin-left: 15px;
    padding: 7px 10px; 
}
.btn-sm{padding: 8px 10px;}
.box-primary{
  border-top-color: #ecf0f5 !important;
  border-top-width: 16px;
  
}
.btn-primary:hover{
     background-color: #1890FF;
    color: #fff;
    border: none;
    opacity: .9;
    border-radius: 6px !important; 
}
.delete-one{
    background-color: ff4141 !important;
    margin-left: 15px;
    border-radius: 6px;
}
.sreachs{
       background-color: #1890FF;
    color: #fff;
    border: none;
    border-radius: 6px !important;
    margin-left: 15px;
    padding: 7px 15px; 
}
</style>
<section class="content-header">
    <ol class="breadcrumb">
        <li>商城管理</li>
        <li class="active">商城订单</li>
    </ol>
</section>
<section class="content">
    <div class="row">
        <div class="col-md-12">
            <div class="box box-primary">

                <div class="box-tools" style="margin:5px;">
                    <form id="form1" action="{:search_url(['mobile'])}" method="GET" pjax-search="">
                        <input type="hidden" name="page" value="1" />
                        <div class="input-group input-group-sm">
                            <div style="width: 247px;">
                                <input name="mobile" style="border: none; border: 1px solid #ccc;padding:2px;height:34px; margin:0 15px;"  value="{:input('get.mobile')}" placeholder="请输入手机号" AUTOCOMPLETE="off">
                                <div class="input-group-btn" style="display: inline-block;">
                                    <button type="submit" class="btn btn-default sreachs">
                                        <i class="fa fa-search"></i> 查询
                                    </button>
                                </div>
                            </div>
                        </div>
                    </form>
                </div>

                <div class="box-header with-border">
                    <div class="pull-left">
                        <!--{:authAction(CONTROLLER_NAME.'/index_del','delete_all')}-->
                        <a href="javascript:xls_explode();" class="btn btn-sm btn-primary"><i class="glyphicon glyphicon-file"></i> 导出</a>
                    </div>
                </div>
                <div class="box-body table-responsive">
                    <table class="table table-bordered table-hover">
                        <tr>
                            <!--<th width="35"><input type="checkbox" class="minimal checkbox-toggle"></th>-->
                            <th>用户名</th>
                            <th>电话</th>
                            <th>订单号</th>
                            <th>产品名</th>
                            <th>支付金额</th>
                            <th>创建时间</th>
                            <th>订单状态</th>
                            <th>操作</th>
                        </tr>
                        {volist name="$list" id="v"}
                        <tr>
                            <!--<td><input type="checkbox" name="id[]" value="{$v.id}" class="minimal checkbox"></td>-->
                            <td>{$user_list[$v["user_id"]]['name']}</td>
                            <td>{$user_list[$v["user_id"]]['mobile']}</td>
                            <td>{$v["order_number"]}</td>
                            <td>
                                {foreach name="$goods_list" item="vo"}
                                {if condition="$v['id'] == $vo['goods_order_id']"}
                                {$vo['name']}
                                {/if}
                                {/foreach}
                            </td>
                            <td>{$v["total_price"]}</td>
                            <td>{:date('Y-m-d H:i', $v["create_time"])}</td>
                            <td>
                                {if condition="$v.status_a eq 0"}待付款{/if}
                                {if condition="$v.status_a eq 1"}待发货{/if}
                                {if condition="$v.status_a eq 2"}待收货{/if}
                                {if condition="$v.status_a eq 3"}已完成{/if}
                            </td>
                            <td>
                                {:authAction(CONTROLLER_NAME.'/index_edit','show',['id'=>$v['id']])}
                            </td>
                        </tr>
                        {/volist}
                    </table>
                </div>
                <div class="box-footer clearfix">
                    {$list->render()}
                </div>
            </div>
        </div>
    </div>
</section>
<script>
    $(function(){
        // 列表部分 全选
        $('input[type="checkbox"].minimal, input[type="radio"].minimal').iCheck({
            checkboxClass: 'icheckbox_minimal-blue',
            radioClass: 'iradio_minimal-blue'
        });
        $('.checkbox-toggle').on('ifChecked', function(event){
            var _this = $(this);
            var _table = _this.closest('.table');
            _table.find("tr td input[type='checkbox']").iCheck("check");
        });
        $('.checkbox-toggle').on('ifUnchecked', function(event){
            var _this = $(this);
            var _table = _this.closest('.table');
            _table.find("tr td input[type='checkbox']").iCheck("uncheck");
        });
    });

    function xls_explode() {
        window.location.href = "{:url('Order/index')}?" + $('#form1').serialize()+'&export=1';
        return false;
    }
</script>
{/block}
